var mainWindow = Titanium.UI.createWindow({
	title:'EMakan',
	//backgroundColor:'red',
	backgroundImage:'images/bg.png',
	    orientationModes: [
        Ti.UI.LANDSCAPE_LEFT,
        Ti.UI.LANDSCAPE_RIGHT,
        Ti.UI.PORTRAIT,
        Ti.UI.UPSIDE_PORTRAIT
    ]
});

var Topview = Titanium.UI.createView({
	top:'0%',
	width:'100%',
	height:'15%',
	//backgroundColor:T("top-view-bg-color")
});

var friendsTap = Titanium.UI.createView({
	width:'25%',
	height:'100%',
	top:'0%',
	left:'0%',
	backgroundColor:"#dd127d"
});

var placesTap = Titanium.UI.createView({
	width:'25%',
	height:'100%',
	top:'0%',
	left:'25%',
	//backgroundColor:"#dd127d"
});

var profileTap = Titanium.UI.createView({
	width:'25%',
	height:'100%',
	top:'0%',
	left:'50%',
	backgroundColor:"#dd127d"
});

var searchTap = Titanium.UI.createView({
	width:'25%',
	height:'100%',
	top:'0%',
	left:'75%',
	backgroundColor:"#dd127d"
});
Topview.add(friendsTap);
Topview.add(placesTap);
Topview.add(profileTap);
Topview.add(searchTap);
mainWindow.add(Topview);

// labels

var friendsLabel = Titanium.UI.createLabel({
	text:"Friends",
	color:'#fff',
	top:'60%',
	left:'25%',
	font:{
		fontSize:'12%'
	}
});


var placesLabel = Titanium.UI.createLabel({
	text:"NearBy",
	color:'#2d2d2d',
	top:'60%',
	left:'25%',
	font:{
		fontSize:'12%'
	}	
});

var profileLabel = Titanium.UI.createLabel({
	text:"Profile",
	color:'#fff',
	top:'60%',
	left:'25%',
	font:{
		fontSize:"12%"
	}	
});

var searchLabel = Titanium.UI.createLabel({
	text:"Search",
	color:'#fff',
	top:'60%',
	left:'25%'	,
	font:{
		fontSize:'12%'
	}
});

friendsTap.add(friendsLabel);
placesTap.add(placesLabel);
profileTap.add(profileLabel);
searchTap.add(searchLabel);

// icons
var friendsIcon = Titanium.UI.createImageView({
	backgroundImage:'images/selected_friends.png',
	left:'20%',
	width:'40%',
	top:'15%',
	height:'40%'
});

friendsTap.add(friendsIcon);

var placesIcon = Titanium.UI.createImageView({
	backgroundImage:'images/selected_map.png',
	left:'20%',
	width:'40%',
	top:'15%',
	height:'40%'
});

placesTap.add(placesIcon);

var profileIcon = Titanium.UI.createImageView({
	backgroundImage:'images/selected_profile.png',
	left:'20%',
	width:'40%',
	top:'15%',
	height:'40%'
});

profileTap.add(profileIcon);

var searchIcon = Titanium.UI.createImageView({
	backgroundImage:'images/selected_search.png',
	left:'20%',
	width:'40%',
	top:'15%',
	height:'40%'
});

searchTap.add(searchIcon);

// containers
var placesContainer = Titanium.UI.createView({
	top:'15%',
	left:'0%',
	height:'100%',
	width:'100%'
	//backgroundColor:'blue'
});

var friendsContainer = Titanium.UI.createView({
	top:'15%',
	left:'0%',
	height:'100%',
	width:'100%'
	//backgroundColor:'red'
});

var profileContainer = Titanium.UI.createView({
	top:'15%',
	left:'0%',
	height:'100%',
	width:'100%'
	//backgroundColor:'yellow'
});

var searchContainer = Titanium.UI.createView({
	top:'15%',
	left:'0%',
	height:'100%',
	width:'100%'
	
	//backgroundColor:'black'
});

mainWindow.add(placesContainer);

mainWindow.open();
Titanium.include('/makan/ui/placesView.js');
Titanium.include('/makan/control/applicationWindowHands.js');